<script lang="ts">
// import { TUIChatKit } from '@/TUIKit'
import { LoginTIM } from '@/utils/TIM'

// 设置客户端类型
uni.setStorageSync('CLIENT', 'DOCTOR')

// TUIChatKit 初始化
// TUIChatKit.init()

// 请按照 $TUICallKit 命名并且通过 uni.$TUICallKit 全局引入，修改命名会出现不生效的情况
uni.$TUICallKit = uni.requireNativePlugin('TencentCloud-TUICallKit');
console.log(uni.$TUICallKit, "TUICallKit ｜ ok"); // 本地日志 

export default {
  onLaunch: async function () {
    const { userId } = uni.getStorageSync('userInfo')
    // const userId = '1'

    // 设置用户ID
    uni.$chat_userID = String(userId)

    console.warn('-- APP: chat_userID ------------------------->', userId)

    // 登录TIM
    if (userId) {
      await LoginTIM(uni.$chat_userID)
    }
  },
  onShow: function () {
    console.log('App Show ----------------》', new Date().getTime())
  },
  onHide: function () {
    console.log('App Hide')
  },
}
</script>
<style lang="less">
/*每个页面公共css */
uni-page-body,
html,
body,
page {
  width: 100% !important;
  height: 100% !important;
  // overflow: hidden;
  background-color: #fafafa;
  font-family: PingFang SC;
}

/deep/.uni-input-input {
  font-size: 26rpx !important;
}

.uni-input-placeholder {
  font-size: 26rpx !important;
}

.zjlx {
  width: 102rpx;
  height: 33rpx;
  background: #fbecd1;
  border-radius: 10rpx;
  font-weight: 500;
  font-size: 22rpx;
  color: #f1ae34;
  text-align: center;
  line-height: 33rpx;
}

.red {
  color: #fb5544;
}

.Realname {
  padding: 5rpx 10rpx;
  background: #f3f8ff;
  border-radius: 10rpx;
  color: #3b6cfe !important;
}

.ptlx {
  width: 102rpx;
  height: 33rpx;
  background: #d2ddfd;
  border-radius: 10rpx;
  font-weight: 500;
  font-size: 22rpx;
  color: #3c6dfe;
  text-align: center;
  line-height: 33rpx;
}

.flex-center-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-sp-center {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.container {
  padding-top: 128rpx;
}

.currency_card {
  width: 690rpx;
  min-height: 51rpx;
  background: #ffffff;
  border-radius: 20rpx;
  padding: 20rpx;
  box-sizing: border-box;

  .currency_title {
    font-weight: bold;
    font-size: 32rpx;
    color: #333333;
  }
}

.btnBoxTow {
  width: 750rpx;
  height: 114rpx;
  background: #ffffff;
  position: fixed;
  bottom: 0;
  padding: 0 50rpx;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;

  view {
    width: 299rpx;
    height: 90rpx;
    text-align: center;
    line-height: 90rpx;
    font-size: 26rpx;
    border-radius: 20rpx;
    color: #ffffff;
  }

  .cancel {
    background: rgba(153, 153, 153, 0.2);
    color: #999999;
  }

  .confirm {
    background: #3e6efe;
  }
}

.flex-center {
  display: flex;
  align-items: center;
}

.rowShow_2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  /* 定义文本的行数 */
  overflow: hidden;
  text-overflow: ellipsis;
}

.CommonToolsbtn {
  width: 649rpx;
  height: 100rpx;
  background: #3b6cfe;
  border-radius: 50rpx;
  font-weight: 500;
  font-size: 28rpx;
  color: #ffffff;
  position: fixed;
  bottom: 108rpx;
  left: 50%;
  transform: translateX(-50%);
}

.mb_30 {
  margin-bottom: 30rpx;
}

.CommonToolsbtn {
  width: 649rpx;
  height: 100rpx;
  background: #3b6cfe;
  border-radius: 50rpx;
  font-weight: 500;
  font-size: 28rpx;
  color: #ffffff;
  position: fixed;
  bottom: 108rpx;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.mb_25 {
  margin-bottom: 25rpx;
}

.kong {
  height: 200rpx;
}

.pb_47 {
  padding-bottom: 47rpx;
}

.pb_37 {
  padding-bottom: 37rpx;
}

.pb_34 {
  padding-bottom: 34rpx;
}

.pb_1 {
  padding-bottom: 1rpx;
}

.pb_30 {
  padding-bottom: 30rpx;
}

.mb_17 {
  margin-bottom: 17rpx;
}

.mt_30 {
  margin-top: 30rpx;
}

.mt_15 {
  margin-top: 15rpx;
}

.fs_22 {
  font-size: 22rpx;
}
</style>
